function getPlatform(){
    return detectPlatform();
}

const detectPlatform = function (url) {
    let platformInfo = '';
    switch (process.platform) {
        case "darwin": //unix 系统内核
            console.log('darwin');
            platformInfo = 'MacOS';
            break;
        case "win32": //windows 系统内核
            console.log('win32');
            platformInfo = 'windows';
            break;
        case "linux": //linux
            console.log('linux');
            platformInfo = 'linux';
            break;
        case "android":
            console.log('android');
            platformInfo = 'android';
            break;

        default:
            console.log('unknown platform');
            platformInfo = 'unknown platform';
            break;

    }
    return platformInfo;
};

module.exports = {
    getPlatform
}

